
import delimited  "/Users/zerenli1992/Dropbox/revolving_door_jmp/replication_files/ind_pref_panel_jop.csv",clear

global reg_rd  "~/Dropbox/revolving_door_jmp/result"

lab var recruitment_1 "Join"
lab var subsidy_dum "Previous Subsidy"

global reg_setting lab dec(3)  noas   nocons 


**# Table A.4 Alternative Time Interval
label var subsidy_dum_l1 "Previous Subsidy,t-1"
label var subsidy_dum_l2 "Previous Subsidy,t-1 to t-2"

* t-1 subsidy
reghdfe recruitment_1 subsidy_dum_l1, absorb(jurisdiction_id  year stkcd )  vce(cluster jurisdiction_id) 
outreg2 using "$reg_rd/time_period.tex", replace $reg_setting addtext("Jurisdiction Firm Year FE", Y ) cttop("Full") 

reghdfe recruitment_1 subsidy_dum_l1, absorb(jurisdiction_id  year stkcd i.stkcd#c.year i.jurisdiction_id#c.year )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/time_period.tex", append $reg_setting addtext("Jurisdiction Firm Year FE", "Y", "Firm Specific Trend", "Y", "Jurisdiction Specific Trend", "Y" ) cttop("Full")  


reghdfe recruitment_1 subsidy_dum_l1, absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/time_period.tex", append $reg_setting  addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" ) cttop("Full")  


reghdfe recruitment_1 subsidy_dum_l1 if level == "prov" , absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/time_period.tex", append $reg_setting addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" ) cttop("Province")  


reghdfe recruitment_1 subsidy_dum_l1 if level == "pref" , absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/time_period.tex", append  $reg_setting addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" )  cttop("Prefecture") 


reghdfe recruitment_1 subsidy_dum_l1 if level == "county" , absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/time_period.tex", append  $reg_setting addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" ) cttop("County")

* t-1 to t-2 subsidy

reghdfe recruitment_1 subsidy_dum_l2, absorb(jurisdiction_id  year stkcd )  vce(cluster jurisdiction_id) 
outreg2 using "$reg_rd/time_period1.tex", replace $reg_setting addtext("Jurisdiction Firm Year FE", Y ) cttop("Full") 

reghdfe recruitment_1 subsidy_dum_l2, absorb(jurisdiction_id  year stkcd i.stkcd#c.year i.jurisdiction_id#c.year )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/time_period1.tex", append $reg_setting addtext("Jurisdiction Firm Year FE", "Y", "Firm Specific Trend", "Y", "Jurisdiction Specific Trend", "Y" ) cttop("Full")  


reghdfe recruitment_1 subsidy_dum_l2, absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/time_period1.tex", append $reg_setting  addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" ) cttop("Full")  



reghdfe recruitment_1 subsidy_dum_l2 if level == "prov" , absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/time_period1.tex", append $reg_setting addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" ) cttop("Province")  


reghdfe recruitment_1 subsidy_dum_l2 if level == "pref" , absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/time_period1.tex", append  $reg_setting addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" )  cttop("Prefecture") 


reghdfe recruitment_1 subsidy_dum_l2 if level == "county" , absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/time_period1.tex", append  $reg_setting addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" ) cttop("County")



**# Table A5: regulatory reform
g subsidy_reform = subsidy_dum*post2013
label var subsidy_reform "Previous Subsidy*Regulatory Reform"


reghdfe recruitment_1  subsidy_reform subsidy_dum , absorb(jurisdiction_id  year stkcd )  vce(cluster jurisdiction_id) 
outreg2 using "$reg_rd/reg_reform.tex", replace $reg_setting addtext("Jurisdiction Firm Year FE", Y ) cttop("Full") 


reghdfe recruitment_1 subsidy_reform subsidy_dum, absorb(jurisdiction_id  year stkcd i.stkcd#c.year i.jurisdiction_id#c.year )  vce(cluster jurisdiction_id)

outreg2 using "$reg_rd/reg_reform.tex", append $reg_setting addtext("Jurisdiction Firm Year FE", "Y", "Firm Specific Trend", "Y", "Jurisdiction Specific Trend", "Y" ) cttop("Full")  


reghdfe recruitment_1 subsidy_reform subsidy_dum, absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)

outreg2 using "$reg_rd/reg_reform.tex", append $reg_setting  addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" ) cttop("Full")  



reghdfe recruitment_1 subsidy_reform subsidy_dum if level == "prov" , absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)

outreg2 using "$reg_rd/reg_reform.tex", append $reg_setting addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" ) cttop("Province")  


reghdfe recruitment_1 subsidy_reform subsidy_dum if level == "pref" , absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)

outreg2 using "$reg_rd/reg_reform.tex", append  $reg_setting addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" )  cttop("Prefecture") 


reghdfe recruitment_1 subsidy_reform subsidy_dum  if level == "county" , absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)

outreg2 using "$reg_rd/reg_reform.tex", append  $reg_setting addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" ) cttop("County")
 

**# Table A.6: Continuous Outcome Variable


reghdfe recruitment_n subsidy_dum, absorb(jurisdiction_id  year stkcd )  vce(cluster jurisdiction_id) 
outreg2 using "$reg_rd/continous_dv.tex", replace $reg_setting addtext("Jurisdiction Firm Year FE", Y ) cttop("Full") 


reghdfe recruitment_n subsidy_dum, absorb(jurisdiction_id  year stkcd i.stkcd#c.year i.jurisdiction_id#c.year )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/continous_dv.tex", append $reg_setting addtext("Jurisdiction Firm Year FE", "Y", "Firm Specific Trend", "Y", "Jurisdiction Specific Trend", "Y" ) cttop("Full")  


reghdfe recruitment_n subsidy_dum, absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/continous_dv.tex", append $reg_setting  addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" ) cttop("Full")  


reghdfe recruitment_n subsidy_dum if level == "prov" , absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/continous_dv.tex", append $reg_setting addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" ) cttop("Province")  


reghdfe recruitment_n subsidy_dum if level == "pref" , absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/continous_dv.tex", append  $reg_setting addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" )  cttop("Prefecture") 


reghdfe recruitment_n subsidy_dum if level == "county" , absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/continous_dv.tex", append  $reg_setting addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" ) cttop("County")


**# Table A.7: Continuous Measure of Government Subsid
g subsidy_size_l = log(subsidy_size+1)
label var subsidy_size_l "Previous Subsidy (Continuous)"


local reg_setting lab dec(4)  noas   nocons 

reghdfe recruitment_1 subsidy_size_l, absorb(jurisdiction_id  year stkcd )  vce(cluster jurisdiction_id) 
outreg2 using "$reg_rd/continous_treatment.tex", replace `reg_setting' addtext("Jurisdiction Firm Year FE", Y ) cttop("Full") 


reghdfe recruitment_1 subsidy_size_l, absorb(jurisdiction_id  year stkcd i.stkcd#c.year i.jurisdiction_id#c.year )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/continous_treatment.tex", append `reg_setting' addtext("Jurisdiction Firm Year FE", "Y", "Firm Specific Trend", "Y", "Jurisdiction Specific Trend", "Y" ) cttop("Full")  


reghdfe recruitment_1 subsidy_size_l, absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/continous_treatment.tex", append `reg_setting'  addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" ) cttop("Full")  



reghdfe recruitment_1 subsidy_size_l if level == "prov" , absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/continous_treatment.tex", append `reg_setting' addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" ) cttop("Province")  


reghdfe recruitment_1 subsidy_size_l if level == "pref" , absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/continous_treatment.tex", append  `reg_setting' addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" )  cttop("Prefecture") 


reghdfe recruitment_1 subsidy_size_l if level == "county" , absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/continous_treatment.tex", append  `reg_setting' addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" ) cttop("County")


**# Table A.8: Recruitment Analysis without Ethnic Minority Areas
reghdfe recruitment_1 subsidy_dum if ethnic == 0, absorb(jurisdiction_id  year stkcd )  vce(cluster jurisdiction_id) 
outreg2 using "$reg_rd/ethnic_minority.tex", replace $reg_setting addtext("Jurisdiction Firm Year FE", Y ) cttop("Full") 


reghdfe recruitment_1 subsidy_dum if ethnic == 0, absorb(jurisdiction_id  year stkcd i.stkcd#c.year i.jurisdiction_id#c.year )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/ethnic_minority.tex", append $reg_setting addtext("Jurisdiction Firm Year FE", "Y", "Firm Specific Trend", "Y", "Jurisdiction Specific Trend", "Y" ) cttop("Full")  


reghdfe recruitment_1 subsidy_dum if ethnic == 0, absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/ethnic_minority.tex", append $reg_setting  addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" ) cttop("Full")  

**# Table A.9: Recruitment Analysis: Without Directly-Administered Municipalities

reghdfe recruitment_1 subsidy_dum if direct == 0, absorb(jurisdiction_id  year stkcd )  vce(cluster jurisdiction_id) 
outreg2 using "$reg_rd/direct.tex", replace $reg_setting addtext("Jurisdiction Firm Year FE", Y ) cttop("Full") 


reghdfe recruitment_1 subsidy_dum if direct == 0, absorb(jurisdiction_id  year stkcd i.stkcd#c.year i.jurisdiction_id#c.year )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/direct.tex", append $reg_setting addtext("Jurisdiction Firm Year FE", "Y", "Firm Specific Trend", "Y", "Jurisdiction Specific Trend", "Y" ) cttop("Full")  


reghdfe recruitment_1 subsidy_dum if direct == 0, absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/direct.tex", append $reg_setting  addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" ) cttop("Full")  


**# Table A.10: Recruitment Analysis: SOE vs Non-SOE

reghdfe recruitment_1 subsidy_dum if soe == 0, absorb(jurisdiction_id  year stkcd )  vce(cluster jurisdiction_id) 
outreg2 using "$reg_rd/soe.tex", replace $reg_setting addtext("Jurisdiction Firm Year FE", Y ) cttop("None-SOEs") 


reghdfe recruitment_1 subsidy_dum if soe == 0, absorb(jurisdiction_id  year stkcd i.stkcd#c.year i.jurisdiction_id#c.year )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/soe.tex", append $reg_setting addtext("Jurisdiction Firm Year FE", "Y", "Firm Specific Trend", "Y", "Jurisdiction Specific Trend", "Y" ) cttop("None-SOEs")  


reghdfe recruitment_1 subsidy_dum if soe == 0, absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/soe.tex", append $reg_setting  addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" ) cttop("None-SOEs")  


reghdfe recruitment_1 subsidy_dum if soe == 1, absorb(jurisdiction_id  year stkcd )  vce(cluster jurisdiction_id) 
outreg2 using "$reg_rd/soe.tex", append $reg_setting addtext("Jurisdiction Firm Year FE", Y ) cttop("SOEs") 


reghdfe recruitment_1 subsidy_dum if soe == 1, absorb(jurisdiction_id  year stkcd i.stkcd#c.year i.jurisdiction_id#c.year )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/soe.tex", append $reg_setting addtext("Jurisdiction Firm Year FE", "Y", "Firm Specific Trend", "Y", "Jurisdiction Specific Trend", "Y" ) cttop("SOEs")  


reghdfe recruitment_1 subsidy_dum if soe == 1, absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/soe.tex", append $reg_setting  addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" ) cttop("SOEs")  

**# Table A.11: Probit Model

probit recruitment_1  subsidy_dum,  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/probit.tex", replace keep(subsidy_dum) $reg_setting  ///
addstat(Log-Likelihood Full Model, e(ll)) addtext("Year FE" ) cttop("Full")


probit recruitment_1  subsidy_dum i.year, vce(cluster jurisdiction_id)

outreg2 using "$reg_rd/probit.tex", append keep(subsidy_dum) addtext("Year FE", "Y" ) cttop("Full") $reg_setting addstat(Log-Likelihood Full Model, e(ll))



**# Table A.12: Recruitment Analysis Using Truncated Sample

reghdfe recruitment_1 subsidy_dum if truncate == 0, absorb(jurisdiction_id  year stkcd )  vce(cluster jurisdiction_id) 
outreg2 using "$reg_rd/truncated.tex", replace $reg_setting addtext("Jurisdiction Firm Year FE", Y ) cttop("Full") 


reghdfe recruitment_1 subsidy_dum if truncate == 0, absorb(jurisdiction_id  year stkcd i.stkcd#c.year i.jurisdiction_id#c.year )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/truncated.tex", append $reg_setting addtext("Jurisdiction Firm Year FE", "Y", "Firm Specific Trend", "Y", "Jurisdiction Specific Trend", "Y" ) cttop("Full")  


reghdfe recruitment_1 subsidy_dum if truncate == 0, absorb(juris_yr firm_yr  )  vce(cluster jurisdiction_id)
outreg2 using "$reg_rd/truncated.tex", append $reg_setting  addtext("Jurisdiction-Year FE", "Y", "Firm-Year FE", "Y" ) cttop("Full")  

